home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / skeleton.zip / Msg.asm < prev    next >
Assembly Source File  |  1996-06-02  |  1KB  |  72 lines

  1.         TITLE    Msg - Handle messages from WndProc
  2.         INCLUDE    COMMON.INC
  3.  
  4. hWnd        TEXTEQU    <[ebp+08h]>
  5. uMsg        TEXTEQU    <[ebp+0Ch]>
  6. wParam        TEXTEQU    <[ebp+10h]>
  7. lParam        TEXTEQU    <[ebp+14h]>
  8.  
  9.  
  10.         .DATA?
  11. hdc        HDC    ?        ;for WM_PAINT
  12. ps        PAINTSTRUCT <>
  13.  
  14.  
  15.         .CODE
  16. MsgWM_PAINT    PROC    STDCALL
  17.         INVOKE    BeginPaint, hWnd, ADDR ps
  18.         mov    hdc,eax
  19.  
  20.         ;!!!!    !!!!!!!!
  21.  
  22.         INVOKE    EndPaint, hWnd, ADDR ps
  23.         ret
  24. MsgWM_PAINT    ENDP
  25.  
  26.  
  27. MsgWM_CREATE    PROC    STDCALL
  28.         INVOKE    GetDesktopWindow
  29.         INVOKE    MiscCenterWnd, hWnd, eax    ;Center Main Window
  30.  
  31.         INVOKE    InitCommonControls
  32.  
  33.         call    CreateSBar
  34.         test    eax,eax
  35.         jz    caseEXIT
  36.  
  37.         call    CreateTBar
  38.         test    eax,eax
  39.         jz    caseEXIT
  40.  
  41.         call    CmdIDM_NEW
  42.  
  43.         jmp    caseCONTINUE
  44.  
  45. caseEXIT:    xor    eax,eax
  46.         dec    eax
  47.         jmp    caseRETURN    ;return -1 to exit
  48.  
  49. caseCONTINUE:    xor    eax,eax        ;return 0 to continue
  50.  
  51. caseRETURN:    ret
  52. MsgWM_CREATE    ENDP
  53.  
  54.  
  55. MsgWM_CLOSE    PROC    STDCALL
  56.         call    SaveChanges
  57.         test    eax,eax        ;CANCEL if FALSE (eax=0)
  58.         jz    caseRETURN
  59.  
  60.         INVOKE    DestroyWindow, hMainWnd
  61.  
  62. caseRETURN:    ret
  63. MsgWM_CLOSE    ENDP
  64.  
  65.  
  66. MsgWM_SIZE    PROC    STDCALL
  67.         INVOKE    SendMessage, hStatusBar, uMsg, wParam, lParam
  68.         INVOKE    SendMessage, hToolBar, uMsg, wParam, lParam
  69.         ret
  70. MsgWM_SIZE    ENDP
  71.  
  72.         END